<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAttachmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('attachments', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('filename')->comment('文件名');
            $table->string('extension')->comment('文件扩展名');
            $table->unsignedBigInteger('size')->comment('文件大小');
            $table->unsignedInteger('width')->default(0)->comment('图片宽度');
            $table->unsignedInteger('height')->default(0)->comment('图片高度');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('attachments');
    }
}
